package br.urca.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
public class AlunoIESPK implements Serializable {

	private static final long serialVersionUID = 1L;
	
	@Column(name = "NumProt", columnDefinition = "VARCHAR(5)")
	private String numProtocolo;
	
	@Column(name = "Periodo", columnDefinition = "VARCHAR(5)")
	private String periodo;
	
	@Column(name = "Cdalucur", columnDefinition = "VARCHAR(11)")
	private String matricula;
	
	@Deprecated public AlunoIESPK() { }

	public AlunoIESPK(String numProtocolo, String periodo, String matricula) {
		super();
		this.numProtocolo = numProtocolo;
		this.periodo = periodo;
		this.matricula = matricula;
	}

	public String getNumProtocolo() {
		return numProtocolo;
	}

	public void setNumProtocolo(String numProtocolo) {
		this.numProtocolo = numProtocolo;
	}

	public String getPeriodo() {
		return periodo;
	}

	public void setPeriodo(String periodo) {
		this.periodo = periodo;
	}

	public String getMatricula() {
		return matricula;
	}

	public void setMatricula(String matricula) {
		this.matricula = matricula;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((matricula == null) ? 0 : matricula.hashCode());
		result = prime * result
				+ ((numProtocolo == null) ? 0 : numProtocolo.hashCode());
		result = prime * result + ((periodo == null) ? 0 : periodo.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		AlunoIESPK other = (AlunoIESPK) obj;
		if (matricula == null) {
			if (other.matricula != null)
				return false;
		} else if (!matricula.equals(other.matricula))
			return false;
		if (numProtocolo == null) {
			if (other.numProtocolo != null)
				return false;
		} else if (!numProtocolo.equals(other.numProtocolo))
			return false;
		if (periodo == null) {
			if (other.periodo != null)
				return false;
		} else if (!periodo.equals(other.periodo))
			return false;
		return true;
	}
	
	
}
